<?php
 include("include/textcenter.php");
 include("include/db.php");
 $id = $_GET["id"];
$result = mysql_query("SELECT o.*, c.*, cp.* from vnf_shop_order o
            left JOIN vnf_customer c ON o.user_id = c.CustomerNo
            left JOIN vnf_coupon cp ON o.coupon_code = cp.CouponID
             where user_id ='$id'");
?>
<html>
<head>
<meta name="description" content="Admin<?php echo $tagdescription?>">
<meta name="keywords" content="<?php echo $tagkeywords?> Main">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><?php echo $tagtitle?></title>

<script type="text/javascript" src="simpletreemenu.js">
/***********************************************
* Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<link rel="stylesheet" type="text/css" href="simpletree.css" />
<link rel="StyleSheet" href="include/css_classes.css" type="text/css">
 <script src="jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="jquery-1.4.2.js"></script>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" link="#0000FF" vlink="#800080" alink="#FF0000" bgcolor="#FFFFFF">
<!-- -------------------Header---------------------------- -->
<?php include("include/header.php"); ?>
<!-- -------------------End Header---------------------------- -->


<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="90%">

	<tr>
		<td width="12%" valign="top">
		<img border="0" src="public/images/homepage/spider16.gif" width="200" height="1"></td>
		<td width="1%" valign="top">
		<img border="0" src="public/images/homepage/spider16.gif" width="16" height="1"></td>
		<td width="86%" valign="top">
		<img border="0" src="public/images/homepage/spider16.gif" width="16" height="1"></td>
	</tr>	
	<tr>
		<!-- ///////////////////Begin Leftmenu/////////////////// -->
		<td width="12%" valign="top" bgcolor="#FFFFFF">
		<?php include("include/leftmenu.php"); ?>
		</td>
		<!-- ///////////////////End Leftmenu/////////////////// -->
		
		<td width="1%" valign="top" background="public/images/homepage/16.gif">&nbsp;</td>
		<td width="86%" valign="top">
<!-- -------------------Begin Body---------------------------- -->
<p class="title16B">&nbsp;<a href="order_list.php">Order list</a> 
<div id="printthis"> 
<table  width="100%" width="70%" cellspacing="0" cellpadding="2" bordercolor="#FFECFF">
<?php
$total=0;
while($row = mysql_fetch_array($result))
{
    $odate_created = strtotime($row['date_created']);
    $sdate_created= date("Y-m-d",$odate_created);
 ?>
<tr class="click">
    <td>
        <p class="title16B"><a href="order_detail.php?id=<?php echo $row['order_id']?>">Order <?php echo $row['order_id'] ?>&nbsp;&nbsp;&nbsp;&nbsp;created date <?php echo date('Y-m-d',strtotime($row['date_created'])) ?></a></p>
    </td>
</tr>
<tr style="border: 0 !important;" class="show">
		<td>
            
            <fieldset style="width: 80%; ">
            <legend>
                <p>
                    	BILL TO:
                </p>
            </legend>
            <table>
                <tr>
                    <td>
                        Customer:
                    </td>
                    <td>
                        	<?php echo $row['BillToName'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Email:
                    </td>
                    <td>
                        	
                    </td>
                </tr>
                <tr>
                    <td>
                        Address:
                    </td>
                    <td>
                        	<?php echo $row['BillToAddress'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        City:
                    </td>
                    <td>
                        	<?php echo $row['BillToCity'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        State:
                    </td>
                    <td>
                        	<?php echo $row['BillToState'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        ZipCode:
                    </td>
                    <td>
                        	<?php echo $row['BillToZipCode'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Country:
                    </td>
                    <td>
                        	<?php echo $row['BillToCountry'] ?><br/>
                    </td>
                </tr>
                 <tr>
                    <td>
                        Phone:
                    </td>
                    <td>
                        	<?php echo $row['BillToPhone'] ?><br/>
                    </td>
                </tr>
                 <tr>
                    <td>
                        Company:
                    </td>
                    <td>
                        	<?php echo $row['BillToCompany'] ?><br/>
                    </td>
                </tr>	
            </table>
            </fieldset>
		</td>
		<td>
            <fieldset style="width: 80%;">
            <legend>
                <p>
                    SHIP TO:
                </p>
            </legend>
    			<table>
                <tr>
                    <td>
                        Customer:
                    </td>
                    <td>
                        	<?php echo $row['ShipToFirstName'].' '.$row['ShipToLastName'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Email:
                    </td>
                    <td>
                        	<?php echo $row['ShipToEmail'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Address:
                    </td>
                    <td>
                        	<?php echo $row['ShipToAddress'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        City:
                    </td>
                    <td>
                        	<?php echo $row['ShipToCity'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        State:
                    </td>
                    <td>
                        	<?php echo $row['ShipToState'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        ZipCode:
                    </td>
                    <td>
                        	<?php echo $row['ShipToZipCode'] ?><br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        Country:
                    </td>
                    <td>
                        	<?php echo $row['ShipToCountry'] ?><br/>
                    </td>
                </tr>
                 <tr>
                    <td>
                        Phone:
                    </td>
                    <td>
                        	<?php echo $row['ShipToPhone'] ?><br/>
                    </td>
                </tr>
                 <tr>
                    <td>
                        Company:
                    </td>
                    <td>
                        	<?php echo $row['ShipToCompany'] ?><br/>
                    </td>
                </tr>	
            </table>
            </fieldset>
        </td>
	</tr>
    <?php
    $total = $total + 1;
    }
    echo "<p class='title16B'>".$total." order</p>";
   // mysql_close($con);
?>
</table>



<!-- -------------------End Body---------------------------- -->

&nbsp;</td>
	</tr>

</table>
</div>
<!-- ----------------------------------------------- -->
<!-- \\\\\\\\\\\\\\\\\\\\\Begin Footer\\\\\\\\\\\\\\\\\\\\\ -->
<?php include("include/footer.php"); ?>
<!-- \\\\\\\\\\\\\\\\\\\\\End Footer\\\\\\\\\\\\\\\\\\\\\ -->
</body>

</html>